package com.ivi.car.module.carstate.presenter;

import android.arch.lifecycle.Lifecycle;

import com.ivi.car.base.BasePresenter;
import com.ivi.car.bean.carstate.CarPartState;
import com.ivi.car.module.carstate.model.IPartStateContract;
import com.trello.rxlifecycle2.LifecycleProvider;

/**
 * Copyright
 * author chengxp
 * date 2018/3/12
 * describe
 * history
 */

public class PartStatePresenter extends BasePresenter<IPartStateContract.View>
        implements IPartStateContract.Presenter {

    public PartStatePresenter(IPartStateContract.View view, LifecycleProvider<Lifecycle.Event> provider) {
        super(view, provider);
    }

    @Override
    public void showMileageDetial(CarPartState state) {
        if (state != null) {
            mView.showMileageDetial(state);
        }
    }

    @Override
    public void showUseTime(CarPartState state) {
        if (state != null) {
            mView.showUseTime(state);
        }
    }

    @Override
    public void showTips(CarPartState state) {
        if (state != null) {
            mView.showTips(state);
        }
    }

    public void setTitle(CarPartState state) {
        if (state != null) {
            mView.setTitle(state);
        }
    }

}
